(*
 * Copyright (C) Citrix Systems Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; version 2.1 only. with the special
 * exception on linking described in file LICENSE.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *)

(** Types used to store compression algorithms: ***************************)

(** Supported compression algorithms *)
type t = Gzip | Zstd

let of_string = function
  | "true" | "gzip" ->
      Some Gzip
  | "zstd" ->
      Some Zstd
  | _ ->
      None

let to_string = function
  | None ->
      "false"
  | Some Gzip ->
      "gzip"
  | Some Zstd ->
      "zstd"
